/*
 * 易族智汇（北京）科技有限公司 版权所有。
 * 未经许可，您不得使用此文件。
 * 官方地址：www.javamall.com.cn
 */
package com.enation.app.javashop.core.client.fallback.trade;

import com.enation.app.javashop.core.client.feignimpl.trade.RechargeClientFeignImpl;
import com.enation.app.javashop.core.handler.BaseFallbackFactory;
import com.enation.app.javashop.framework.database.WebPage;
import com.enation.app.javashop.model.member.dto.DepositeParamDTO;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * 促销商品熔断
 *
 * @author fk
 * @version v7.0
 * @date 20/3/2 下午6:44
 * @since v7.2
 */
@Component
public class RechargeClientFallbackFactory extends BaseFallbackFactory<RechargeClientFeignImpl> implements FallbackFactory {


    @Override
    protected RechargeClientFeignImpl fallback() {
        return new RechargeClientFallback();
    }

    /**
     * 促销商品熔断
     *
     * @author fk
     * @version v7.0
     * @date 20/3/2 下午6:44
     * @since v7.2
     */
    @Component
    public static class RechargeClientFallback implements RechargeClientFeignImpl {

        protected final Log logger = LogFactory.getLog(this.getClass());

        @Override
        public WebPage list(DepositeParamDTO paramDTO) {
            logger.error("交易服务异常");
            return null;
        }
    }
}
